#include<stdio.h>

int Factorial( const int N )
{
    if (N<0)
    {
        return 0;
    }
    
    int q = N;
    int sum = 1;
    for (int i = 0; i < N; i++)
    {
        sum *=q ;
        q--;
    }
    
    return sum;
}


int main(){    int N, NF;    scanf("%d", &N);
    NF = Factorial(N);    if (NF)  printf("%d! = %d\n", N, NF);    else printf("Invalid input\n");    return 0;
}
